package com.xbj.voa.common.shiroAndJwt;

import org.springframework.stereotype.Component;

/**
 * @author: 木火
 * @create: 2024-01-07
 * @description:用于将shiroFilter生成的token,传递给TokenAspect
 **/
@Component
public class ThreadLocalToken  {
    private ThreadLocal<String> threadLocal = new ThreadLocal<>();

    public void setToken(String token){
        threadLocal.set(token);
    }

    public String getToken(){
        String token = threadLocal.get();
        return token;
    }

    public void clear(){
        threadLocal.remove();
    }
}
